package com.movitech.mobile.cz.base.supplier.service;

import com.baomidou.mybatisplus.service.IService;
import com.movitech.mobile.cz.base.modules.controller.RestReturnResult;
import com.movitech.mobile.cz.base.supplier.bizvo.*;
import com.movitech.mobile.cz.base.supplier.entity.SSuppliers;
import com.movitech.mobile.cz.base.supplier.entity.ext.ExtSSuppliers;
import com.movitech.mobile.cz.base.supplier.entity.ext.RankHistoryReqVO;
import com.movitech.mobile.cz.base.supplier.entity.ext.SupplierSyncVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 供方基本情况 服务类
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-02-28
 */
public interface SSuppliersService extends IService<SSuppliers> {

	public List<ExtSSuppliers> getSuppliersByIdOrCode(Map<String, Object> mapParms);

	/***
	 * 根据id，获取详情SuppliersResponseVO对象
	 * @param id
	 * @return
	 */
	public RestReturnResult<SuppliersDetailVO> getSuppliersById(String id);

	/***
	 * 根据子表id，获取详情SuppliersResponseVO对象
	 * @param relatedId
	 * @return
	 */
	public RestReturnResult<SuppliersDetailVO> getByRelatedId(String relatedId);

	/***
	 * 外网新增供方信息
	 * @param suppliersDetailVO
	 * @return
	 */
	public RestReturnResult<Object> outerSaveSuppliers(SuppliersDetailVO suppliersDetailVO);

	/***
	 * 外网更新供方信息
	 * @param suppliersDetailVO
	 * @return
	 */
	public RestReturnResult<Object> outerUpdateSuppliers(HttpServletRequest request,SuppliersDetailVO suppliersDetailVO);

	/***
	 * 内网更新
	 * @param suppliersDetailVO
	 * @return
	 */
	public RestReturnResult<Object> innerUpdateSuppliers(SuppliersDetailVO suppliersDetailVO);

	/**
	 * 供方列表-潜在列表(分页)
	 * @param suppliersRequestVO
	 * @return
	 */
	public RestReturnResult getSuppliersMulitList(SuppliersRequestVO suppliersRequestVO);

	/**
	 * 供方列表-其他列表(分页)
	 * @param suppliersRequestVO
	 * @return
	 */
	public RestReturnResult getSuppliersList(SuppliersRequestVO suppliersRequestVO);

	public RestReturnResult getQualifiedSuppliersList(SuppliersRequestVO suppliersRequestVO);

	/**
	 * 根据地区公司ids查询地区公司names
	 * @param regionalCompanyIds
	 * @return
	 */
	public String getRegionalCompanyNamesByIds(String regionalCompanyIds);

	public RestReturnResult<Object> fallbackSuppliers(String supplierId,Integer actionType,String sHistoryCommentId);

	SSuppliers getById(String id);

	/**
	 * 供方列表-黑库列表(分页)接口
	 * @param suppliersRequestVO
	 * @return
	 */
	public RestReturnResult getSuppliersBlackList(SuppliersRequestVO suppliersRequestVO);

	SSuppliers getBySysUserId(String userId);

	/**
	 *供方列表-母公司列表接口
	 * @return
	 */
	public RestReturnResult getCompanyListByStatus(String supplierStatus);

	/**
	 * 校验登录名是否存在
	 * @param loginName
	 * @param checkType (1:注册 2：登录/修改密码)
	 */
	public RestReturnResult checkLoginName(String loginName, int checkType);

	/**
	 * 校验营业执照号/统一社会信用代码
	 */
	public RestReturnResult checkCodeOrNumber(SubSupplierRequestVO subSupplierRequestVO);

	String getSupplierIdBySysId(String userId);

	/**
	 * 获取可供选择的供方
	 * @param regionalCompanyId
	 * @param purchaseClassification
	 * @return
	 */
	public RestReturnResult getSelectSupplierListByCompanyIdAndServiceCategoryIds(String regionalCompanyId, String purchaseClassification);

	public RestReturnResult getSuppliersAll(SuppliersRequestVO suppliersRequestVO);

	boolean isExistCompanyName(String companyName,String id);

	SSuppliers getByCompanyName(String companyName);

	List<SuppliersResponseVO> getQualifiedSuppliersListNoPage(SuppliersRequestVO suppliersVO) ;

    List<SSuppliers> selectRankable(RankHistoryReqVO vo);

    /**
     *  批量查询供方编码为空的供方，同步到主数据，更新编码
     */
	void batchSynSuppliers2Mdm();

	/**
	 * 查询供应商基本信息，同步至成本系统。 查询条件：已经同步至主数据系统；供应商不在修改审核状态;
	 * @return
	 */
	SupplierSyncVO getSupplierListForSyncCost();
}
